<template>
  <div class="content">
    <div class="md-layout">
      <div class="md-layout-item md-medium-size-100 md-xsmall-size-100 md-size-100">
        <BaseInfo :formdata="applydata"></BaseInfo>
        <CustomerInfo :formdata="applydata"></CustomerInfo>
        <CautionerInfo :formdata="applydata"></CautionerInfo>
        <EmergencyInfo :formdata="applydata"></EmergencyInfo>
        <mycomment :commentdata="commentdata"></mycomment>
        <mylog :logdata="logdata"></mylog>
      </div>
    </div>
  </div>
</template>

<script>
import '@/assets/scss/main.scss'
import BaseInfo from './Common/BaseInfo.vue'
import CustomerInfo from './Common/CustomerInfo.vue'
import LogList from './Common/LogList.vue'
import CommentList from './Common/CommentList.vue'
import CautionerInfo from './Common/CautionerInfo.vue'
import EmergencyInfo from './Common/EmergencyInfo.vue'

export default{
  components: {
    'mylog': LogList,
    'mycomment': CommentList,
    BaseInfo,
    CustomerInfo,
    CautionerInfo,
    EmergencyInfo
  },
  data () {
    return {
      applyid: '',
      applydata: {},
      logdata: [],
      commentdata: []
    }
  },
  mounted: function () {
    this.applyid = this.$route.params.id
    if (this.applyid !== 'new') {
      var _this = this
      this.$http({
        method: 'get',
        url: 'http://10.42.0.77:9090/article/test/getApplyById?id=' + this.applyid
      }).then(function (res) {
        // alert(JSON.stringify(res));
        // console.log(res.data.applydata)
        // Vue.set(data,'applylist', res.data.returnData.list)
        // alert(JSON.stringify(res.data.loglist));
        _this.applydata = res.data.info
        _this.commentdata = res.data.commentlist
        _this.logdata = res.data.loglist
      })
    } else {
      this.applydata = {}
    }
  }
}
</script>
<style scoped lang="scss">
</style>
